import { stringify } from "qs";
import request from "@/utils/request";

export async function listPermission(params) {
  //   console.log(stringify(params));
  return request(`/api/account/accPermission/?${stringify(params)}`);
}

export async function listAllPermission() {
  // console.log("11111");
  return request("/api/account/accPermission/listAll");
}

export async function createPermission(params) {
  return request("/api/account/accPermission/create", {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function updatePermission(params) {
  return request("/api/account/accPermission/update", {
    method: "POST",
    body: {
      ...params
    }
  });
}

export async function deletePermission(params) {
  return request(`/api/account/accPermission/delete/${params.id}`);
}
